<?php
header("content-type:text/html;charset=utf-8");
//取得表单值
$corname=trim($_POST["corname"]);
$linkname=trim($_POST["linkname"]);
$tel=trim($_POST["tel"]);
$mobile=trim($_POST["mobile"]);
$fax=trim($_POST["fax"]);
$email=trim($_POST["email"]);
$website=trim($_POST["website"]);
$province=trim($_POST["prv"]);
$city=trim($_POST["city"]);
$address=trim($_POST["address"]);
$business=trim($_POST["business"]);
$code=trim($_POST["code"]);
$memo=trim($_POST["memo"]);
$type=trim($_POST["type"]);

//判断表单值是否为空，并插入数据库
if($corname==""||$linkname==""||$tel==""||$mobile==""||$address==""||$business=="" || empty($type)){
    echo"<script>alert('表单加*号的不能为空');window.history.back();</script>";
    exit();
}else{
    include("./inc/conn.php");
    $applytime = date("Y-m-d H:i:s");    
    $sqlstr="insert into ssq_applyinfo(corname,linkname,tel,mobile,fax,code,email,website,province,city,address,business,memo,applytime,type) values('$corname', '$linkname', '$tel', '$mobile', '$fax', '$code', '$email', '$website', '$province', '$city', '$address', '$business', '$memo', '$applytime', '$type')";	
    $result=mysql_query($sqlstr)
    if(!$result){
        echo"<script>alert('由于网络问题，申请出错啦，请重新填写一次');window.location.href='./joininfo.php';</script>";
        exit();
    }else{
        echo"<script>alert('提交申请成功，我们会及时审，请下载金手指软件代理商资格申请表');window.location.href='./joinfinish.php';</script>";
		session_start();
		$_SESSION['download'] = 'true';
    }
}
mysql_close($conn);
?>